/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.oneCommerce.beans;

import com.oneCommerce.entities.Photos;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author Aymen
 */
@Stateless
public class PhotosFacade extends AbstractFacade<Photos> {
    @PersistenceContext(unitName = "oneCommercePU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public PhotosFacade() {
        super(Photos.class);
    }

    public Photos findUserByIdPhoto(BigDecimal idphoto) {
        Map<String, Object> parameters = new HashMap<String, Object>();
	parameters.put("idphoto", idphoto);		
        return super.findOneResult(Photos.FIND_BY_IDPHOTO, parameters);
    }
    
}
